<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    function Cat(name, color) {
        // 实例
        this.name = name;
        this.color = color;
    }

    Cat.prototype.species = "猫";
    Cat.prototype.say = function () {
        console.log(this.name, this.color);
    }
    Cat.prototype.sayHello = function () {
        console.log("hello");
    }


    console.dir(Cat);


    var Tom = new Cat("Tom", "black");
    console.log(Tom);

    // Tom自己的
    console.log(Tom.name, Tom.color);

    // 自己没有就找  Tom.__proto__  => Cat.prototype
    console.log(Tom.species);
    Tom.say();

    // Cat.prototype找不到   Cat.prototype.__proto__  => Object.prototype
    console.log(Tom.toString);

    //  Object.prototype  =>  Object.prototype.__proto__  null;

    // Tom(实例本身) => Tom.__proto__ (Cat.prototype) => Cat.prototype.__proto__ (Object.prototype)  =>   null








</script>

</html>